package com.aijiang.ui;

import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.JPanel;

public class JPanelAnimat extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public SoftIcons icons = new SoftIcons();
	public int x, y, picname;
	public Index index;

	public JPanelAnimat(int x, int y, int picname, Index index) {
		this.setOpaque(false);// 设置panel为透明
		this.x = x;
		this.y = y;
		this.picname = picname;
		this.index = index;
	}

	@Override
	public void paintComponent(Graphics g) {
		super.paintComponent(g);
		Dimension size = this.getParent().getSize();
		index.sleep.draw(g, size.width, size.height);
		index.wait.draw(g, size.width, size.height);
		index.dance.draw(g, size.width, size.height);
		index.speak.draw(g, size.width, size.height);
		index.jump.draw(g, size.width, size.height);

		// if(index.dialog.say ){
		// index.dialog.draw(g);
		//// g.drawString(index.softdao.behave.word, 10, 20);
		// }

		// Dimension size=this.getParent().getSize();
		// g.drawImage(icons.JUMP_IMG[picname], x , y,size.width,size.height,
		// null);
	}

}
